<template>
	<view class="main">
		<u-navbar :is-back="true" title="实名认证" :background="background" :border-bottom="false" title-color="#fff"
			title-size="35rpx" title-bold="true" back-icon-color="#fff">
		</u-navbar>
		<view class="form">
			<view class="name">
				<label>姓名</label><input type="text" value="" v-model="name" placeholder="请输入真实姓名" />
			</view>
			<view class="name">
				<label>身份证号</label><input type="number" value="" v-model="idcard" placeholder="请输入身份证号" />
			</view>
		</view>
		<view class="button" @click="realcard">
			提交
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#111111',
					// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
				},
				name:'',
				idcard:'',
			}
		},
		methods: {
			realcard(){
				global.$http.request({
					url:'/api/setting/checking_realname',
					data:{
						realname:this.name,
						identity_number:this.idcard,
						token:uni.getStorageSync('token')
					},
					
				}).then(res=>{
				this.name='',
				this.idcard='',
					console.log(res);
					if(res.data.code==0){
						setTimeout(function(){
							uni.navigateBack({
								delta: 1
							},2000);
						},)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		font-family: PingFang SC-Regular, PingFang SC;
		background-color: #111111;
		width: 750rpx;

		.main {
			margin-top: 24rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
		
			.form{
			width: 686rpx;
			background: #181818;
			border-radius: 32rpx ;
			padding: 32rpx 24rpx;
			opacity: 1;
				.name{
					padding: 34rpx 0;
					label{
						width: 180rpx;
						font-size: 32rpx;
						font-weight: 400;
						color: #FFFFFF;
					
					}
					input{
						font-size: 32rpx;
						font-weight: 400;
						color: #FFFFFF;
						opacity: 0.8;
					}
					display: flex;
					
				}
			}
			.button{
			padding: 24rpx 128rpx;
			background: #F3C860;
			border-radius: 46rpx;
			opacity: 1;
			font-size: 32rpx;
			font-weight: bold;
			color: #333333;
			margin-top: 102rpx;
			}
		}
	}
</style>
